package com.student.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SchoolInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "School_Info", schema = "dbo", catalog = "StudentManager")
public class SchoolInfo implements java.io.Serializable {

	// Fields

	private Long schoolZoneId;
	private String schoolZoneName;
	private Set<College> colleges = new HashSet<College>(0);

	// Constructors

	/** default constructor */
	public SchoolInfo() {
	}

	/** minimal constructor */
	public SchoolInfo(Long schoolZoneId, String schoolZoneName) {
		this.schoolZoneId = schoolZoneId;
		this.schoolZoneName = schoolZoneName;
	}

	/** full constructor */
	public SchoolInfo(Long schoolZoneId, String schoolZoneName,
			Set<College> colleges) {
		this.schoolZoneId = schoolZoneId;
		this.schoolZoneName = schoolZoneName;
		this.colleges = colleges;
	}

	// Property accessors
	@Id
	@Column(name = "School_Zone_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getSchoolZoneId() {
		return this.schoolZoneId;
	}

	public void setSchoolZoneId(Long schoolZoneId) {
		this.schoolZoneId = schoolZoneId;
	}

	@Column(name = "School_Zone_Name", nullable = false, length = 20)
	public String getSchoolZoneName() {
		return this.schoolZoneName;
	}

	public void setSchoolZoneName(String schoolZoneName) {
		this.schoolZoneName = schoolZoneName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "schoolInfo")
	public Set<College> getColleges() {
		return this.colleges;
	}

	public void setColleges(Set<College> colleges) {
		this.colleges = colleges;
	}

}